using System;
using System.Collections.Generic;
using System.Text;

namespace Com.ContentRendering.Api.ParserEngine.Exceptions
{
    /// <summary/>
    public class ParserException : Exception
    {
        private char _value;
        private int _line;
        private int _column;
        private string _debugBuffer;

        /// <summary/>
        internal ParserException(
            Exception exception,
            char value,
            int line,
            int column,
            string debugBuffer) 
            : base
            (
            null,
            exception)
        {
            this._value = value;
            this._line = line;
            this._column = column;
            this._debugBuffer = debugBuffer;
        }

        /// <summary/>
        public char Value
        {
            get { return _value; }
        }

        /// <summary/>
        public int Line
        {
            get { return _line; }
        }

        /// <summary/>
        public int Column
        {
            get { return _column; }
        }

        /// <summary/>
        public string DebugBuffer
        {
            get { return _debugBuffer; }
        }

        /// <summary/>
        public override string Message
        {
            get
            {
                return string.Format(
                    Constant.EXCEPTION_PARSE,
                    this._value,
                    this._line,
                    this._column,
                    this._debugBuffer);
            }
        }
    }
}
